import { getdetaillist } from '../utils/api'

const detail = {
    namespaced: true,
    state: () => ({
        //详情页数据
        detaillist: []
    }),
    mutations: {
        //详情页
        changedetail(state, payload) {
            state.detaillist = payload.detaillist
        }
    },
    actions: {
        //详情页
        async getdetaillist({ commit }, payload) {
            const result = await getdetaillist({
                productId: payload.productId
            });
            commit('changedetail', {
                detaillist: result.result
            })
        }
    },
    modules: {}
}

export default detail